package com.cuicuisha.framework.biz.context.config;

import com.cuicuisha.framework.biz.context.filter.HeaderUserIdContextFilter;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;

@AutoConfiguration
public class ContextAutoConfiguration {

    @Bean
    public FilterRegistrationBean<HeaderUserIdContextFilter> filterFilterRegistrationBean() {
        HeaderUserIdContextFilter filter = new HeaderUserIdContextFilter();
        FilterRegistrationBean<HeaderUserIdContextFilter> bean = new FilterRegistrationBean<>(filter);
        return bean;
    }
}
